package zhtt.example.service;/*
package zhtt.example.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.client.ServiceInstance;
import org.springframework.cloud.client.loadbalancer.LoadBalancerClient;
import org.springframework.stereotype.Service;
import reactor.core.publisher.Mono;

@Service
public class LoadBalancerService {

    private final LoadBalancerClient loadBalancerClient;

    @Autowired
    public LoadBalancerService(LoadBalancerClient loadBalancerClient) {
        this.loadBalancerClient = loadBalancerClient;
    }

    public Mono<ServiceInstance> getServiceInstance(String serviceName) {
        return Mono.fromCallable(() -> loadBalancerClient.choose(serviceName));
    }
}
*/
